<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>撰写新文章 - Hello World - Powered by Typecho</title>
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
        <meta name="robots" content="noindex,nofollow" />
        <link rel="stylesheet" type="text/css" href="http://typecho/admin/css/reset.source.css?v=9.7.2" /> 
		<link rel="stylesheet" type="text/css" href="http://typecho/admin/css/grid.source.css?v=9.7.2" /> 
		<link rel="stylesheet" type="text/css" href="http://typecho/admin/css/typecho.source.css?v=9.7.2" />
		<link rel="stylesheet" type="text/css" href="http://typecho/usr/plugins/tyupoo/css/tyupoo.css" />
    </head>
    <body>
    	<div class="tyupoo_box tyupoo_tips">
    		<div class="tyupoo_box_head">
    			<h4>title</h4><a href="#" title="close">X</a>
			</div>
			<div class="tyupoo_box_body">
				<p>content</p>
			</div>
    	</div>
		
		<div class="tyupoo_box tyupoo_frame">
    		<div class="tyupoo_box_head">
    			<h4>title</h4><a href="#" title="close">X</a>
			</div>
			<div class="tyupoo_box_body">
				<iframe width="100%" height="300px" scrolling="no" frameborder="0" src="http://www.baidu.com"></iframe>
			</div>			
		</div>
		
<div class="typecho-head-guid body-950">
    <dl id="typecho:guid">
        <dt><a href="http://typecho/admin/index.php" title="控制台">控制台</a></dt>
<dd><ul>
<li><a href="http://typecho/admin/index.php" title="概要">概要</a></li>
<li><a href="http://typecho/admin/profile.php" title="个人设置">个人设置</a></li>
<li><a href="http://typecho/admin/plugins.php" title="插件">插件</a></li>
<li><a href="http://typecho/admin/themes.php" title="外观">外观</a></li>
</ul></dd>
<dt class="focus"><a href="http://typecho/admin/write-post.php" title="创建">创建</a></dt>
<dd><ul>
<li class="focus"><a href="http://typecho/admin/write-post.php" title="撰写文章">撰写文章</a></li>
<li><a href="http://typecho/admin/write-page.php" title="创建页面">创建页面</a></li>
</ul></dd>
<dt><a href="http://typecho/admin/manage-posts.php" title="管理">管理</a></dt>
<dd><ul>
<li><a href="http://typecho/admin/manage-posts.php" title="文章">文章</a></li>
<li><a href="http://typecho/admin/manage-pages.php" title="独立页面">独立页面</a></li>
<li><a href="http://typecho/admin/manage-comments.php" title="评论">评论</a></li>
<li><a href="http://typecho/admin/manage-metas.php" title="标签和分类">标签和分类</a></li>
<li><a href="http://typecho/admin/manage-medias.php" title="附件">附件</a></li>
<li><a href="http://typecho/admin/manage-users.php" title="用户">用户</a></li>
</ul></dd>
<dt><a href="http://typecho/admin/option-general.php" title="设置">设置</a></dt>
<dd><ul>
<li><a href="http://typecho/admin/option-general.php" title="基本">基本</a></li>
<li><a href="http://typecho/admin/option-discussion.php" title="评论">评论</a></li>
<li><a href="http://typecho/admin/option-reading.php" title="文章">文章</a></li>
<li><a href="http://typecho/admin/option-permalink.php" title="永久链接">永久链接</a></li>
</ul></dd>
    </dl>
    <p class="operate">欢迎, <a href="http://typecho/admin/profile.php" class="author important">admin</a>
            <a class="exit" href="http://typecho/index.php/action/logout" title="登出">登出</a></p>
</div>
<div class="main">
    <div class="body body-950">
        <div class="container typecho-page-title">
    <div class="column-24 start-01">
        <h2>撰写新文章</h2>
        <p><a href="http://typecho/">查看我的站点</a></p>
    </div>
</div>
        <div class="container typecho-page-main typecho-post-option typecho-post-area">
            <form action="http://typecho/index.php/action/contents-post-edit" method="post" name="write_post">
                <div class="column-18 start-01" id="test">
                    <div class="column-18">
                        <label for="title" class="typecho-label">标题</label>
                        <p class="title"><input type="text" id="title" name="title" value="" class="text title" /></p>
                        <label for="text" class="typecho-label">内容<cite id="auto-save-message"></cite></label>
                        <p><textarea style="height: 395px" autocomplete="off" id="text" name="text"></textarea></p>
                        <label for="tags" class="typecho-label">标签</label>
                        <p><input id="tags" name="tags" type="text" value="" class="text" /></p>
                                                <p class="submit">
                            <span class="left">
                                <span class="advance close">展开高级选项</span>
                                <span class="attach">展开附件</span>
                            </span>
                            <span class="right">
                                <input type="hidden" name="cid" value="" />
                                <input type="hidden" name="draft" value="0" />
                                <input type="hidden" name="do" value="insert" />
                                <button type="button" id="btn-save">保存并继续编辑</button>
                                <button type="submit" id="btn-submit">发布这篇文章 &raquo;</button>
                            </span>
                        </p>
                    </div>
                    <ul id="advance-panel" class="typecho-post-option column-18">
                        <li class="column-18">
                            <div class="column-12">
                                    <label for="password" class="typecho-label">密码</label>
                                    <p><input type="text" id="password" name="password" value="" class="mini" /></p>
                                    <p class="description">为这篇日志分配一个密码, 访问者需要输入密码才能阅读到日志的内容</p>
                                    <br />
                                    <label for="trackback" class="typecho-label">引用通告</label>
                                    <textarea id="trackback" name="trackback"></textarea>
                                    <p class="description">每一行一个引用地址, 用回车隔开</p>
                                                                </div>
                            <div class="column-06">
                                <label class="typecho-label">权限控制</label>
                                <ul>
                                    <li><input id="allowComment" name="allowComment" type="checkbox" value="1" checked="true" />
                                    <label for="allowComment">允许评论</label></li>
                                    <li><input id="allowPing" name="allowPing" type="checkbox" value="1" checked="true" />
                                    <label for="allowPing">允许被引用</label></li>
                                    <li><input id="allowFeed" name="allowFeed" type="checkbox" value="1" checked="true" />
                                    <label for="allowFeed">允许在聚合中出现</label></li>
                                                                    </ul>
                            </div>
                        </li>
                    </ul>
                    <ul id="upload-panel" class="column-18">
                        <li class="column-18">
                            

<style>
.upload-progress {
    font-size: 12px;
}

#upload-panel ul li.upload-progress-item {
	background-image: url(http://typecho/admin/images/progress.gif);
	background-repeat: repeat-y;
	background-position: -1000px 0;
    background-color: #fff;
    padding: 5px;
    margin-bottom: 5px;
    border: 1px solid #C1CD94;
    
	-moz-border-radius-topleft: 2px;
	-moz-border-radius-topright: 2px;
	-moz-border-radius-bottomleft: 2px;
	-moz-border-radius-bottomright: 2px;
	-webkit-border-top-left-radius: 2px;
	-webkit-border-top-right-radius: 2px;
	-webkit-border-bottom-left-radius: 2px;
	-webkit-border-bottom-right-radius: 2px;
	
	/* hope IE support border radius, God save me! */
	border-top-left-radius: 2px;
	border-top-right-radius: 2px;
	border-bottom-left-radius: 2px;
	border-bottom-right-radius: 2px;
}

.upload-progress-item strong {
    float: left;
}

.upload-progress-item strong.delete {
    text-decoration: line-through;
}

.upload-progress-item small {
    float: right;
    font-size: 8pt;
}

.upload-progress-item small .insert, .upload-progress-item small .delete {
    cursor: pointer;
    text-decoration: underline;
}

.upload-progress-item small .insert {
    color: #00AA00;
}

.upload-progress-item small .delete {
    color: #CC0000;
}
</style>

<div class="typecho-list-operate">
<p class="search left">
    <a class="button left">上传文件 <small style="font-weight:normal">(10M)</small></a>
    <span id="swfu"><span id="swfu-placeholder"></span></span>
</p>
</div>

<ul class="upload-progress">
</ul>
                        </li>
                    </ul>
                </div>
                <div class="column-06 start-19">
                    <ul class="typecho-post-option">
                        <li>
                            <label for="date" class="typecho-label">日期</label>
                            <p>
                                <select name="month" id="month">
                                    <option value="1" >一月</option>
                                    <option value="2" >二月</option>
                                    <option value="3" >三月</option>
                                    <option value="4" >四月</option>
                                    <option value="5" >五月</option>
                                    <option value="6" >六月</option>
                                    <option value="7" >七月</option>
                                    <option value="8" selected="true">八月</option>
                                    <option value="9" >九月</option>
                                    <option value="10" >十月</option>
                                    <option value="11" >十一月</option>
                                    <option value="12" >十二月</option>
                                </select>
                                <input size="4" maxlength="4" type="text" name="day" id="day" value="23" />
                                ,
                                <input size="4" maxlength="4" type="text" name="year" id="year" value="2009" />
                                @
                                <input size="2" maxlength="2" type="text" name="hour" id="hour" value="16" />
                                :
                                <input size="2" maxlength="2" type="text" name="min" id="min" value="10" />
                            </p>
                            <p class="description">请选择一个发布日期</p>
                        </li>
                        <li>
                            <label class="typecho-label">分类</label>
                            <ul>
                                                                                                                                <li><input type="checkbox" id="category-1" value="1" name="category[]" />
                                <label for="category-1">默认分类</label></li>
                                                            </ul>
                        </li>
                        <li>
                            <label for="slug" class="typecho-label">缩略名</label>
                            <p><input type="text" id="slug" name="slug" value="" class="mini" /></p>
                            <p class="description">为这篇日志自定义链接地址, 有利于搜索引擎收录</p>
                        </li>
                                                                    </ul>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="typecho-foot">
    <h4><a href="http://typecho.org" class="logo-dark">typecho</a></h4>
    <div class="copyright">基于 <em>Typecho 0.7</em> <small> | 9.7.2</small> 构建</div>
    <div class="resource">
        <ul>
            <li><a href="http://typecho.org">文档</a></li>
            <li><a href="http://forum.typecho.org">支持论坛</a></li>
            <li><a href="http://code.google.com/p/typecho/issues/entry">报告错误</a></li>
            <li><a href="#">其他资源</a></li>
        </ul>
    </div>
</div>
<script type="text/javascript" src="http://typecho/admin/javascript/mootools.js?v=9.7.2"></script> 
<script type="text/javascript" src="http://typecho/admin/javascript/typecho.js?v=9.7.2"></script>
<script type="text/javascript">
    (function () {
        window.addEvent('domready', function() {
            var _d = $(document);
            var handle = new Typecho.guid('typecho:guid', {offset: 1, type: 'mouse'});
            
            //增加高亮效果
            (function () {
                var _hlId = '';
                
                if (_hlId) {
                    var _hl = _d.getElement('#' + _hlId);
                    
                    if (_hl) {
                        _hl.set('tween', {duration: 1500});
            
                        var _bg = _hl.getStyle('background-color');
                        if (!_bg || 'transparent' == _bg) {
                            _bg = '#F7FBE9';
                        }

                        _hl.tween('background-color', '#AACB36', _bg);
                    }
                }
            })();

            //增加淡出效果
            (function () {
                var _msg = _d.getElement('.popup');
            
                if (_msg) {
                    (function () {

                        var _messageEffect = new Fx.Morph(this, {
                            duration: 'short', 
                            transition: Fx.Transitions.Sine.easeOut
                        });

                        _messageEffect.addEvent('complete', function () {
                            this.element.setStyle('display', 'none');
                        });

                        _messageEffect.start({'margin-top': [30, 0], 'height': [21, 0], 'opacity': [1, 0]});

                    }).delay(5000, _msg);
                }
            })();
            
            //增加滚动效果,滚动到上面的一条error
            (function () {
                var _firstError = _d.getElement('.typecho-option .error');
    
                if (_firstError) {
                    var _errorFx = new Fx.Scroll(window).toElement(_firstError.getParent('.typecho-option'));
                }
            })();

            //禁用重复提交
            (function () {
                _d.getElements('input[type=submit]').removeProperty('disabled');
                _d.getElements('button[type=submit]').removeProperty('disabled');
    
                var _disable = function (e) {
                    e.stopPropagation();
                    
                    this.setProperty('disabled', true);
                    this.getParent('form').submit();
                    
                    return false;
                };

                _d.getElements('input[type=submit]').addEvent('click', _disable);
                _d.getElements('button[type=submit]').addEvent('click', _disable);
            })();

            //打开链接
            (function () {
                
                _d.getElements('a').each(function (item) {
                    var _href = item.href;
                    
                    if (_href && 0 != _href.indexOf('#')) {
                        //确认框
                        item.addEvent('click', function (event) {
                            var _lang = this.get('lang');
                            var _c = _lang ? confirm(_lang) : true;
                
                            if (!_c) {
                                event.stop();
                            }
                        });
        
                        /** 如果匹配则继续 */
                        if (/^http\:\/\/typecho\/admin\/.*$/.exec(_href) 
                            || /^http\:\/\/typecho\/index\.php\/action\/[_a-zA-Z0-9\/]+.*$/.exec(_href)) {
                            return;
                        }
            
                        item.addEvent('click', function () {            
                            window.open(this.href);
                            return false;
                        });
                    }
                });
            })();
            
            Typecho.Table.init('.typecho-list-table');
            Typecho.Table.init('.typecho-list-notable');
        });
    })();
</script>

<script type="text/javascript">
    (function () {
        window.addEvent('domready', function() {
        
            /** 绑定按钮 */
            $(document).getElement('span.advance').addEvent('click', function () {
                Typecho.toggle('#advance-panel', this,
                '收起高级选项', '展开高级选项');
            });
            
            $(document).getElement('span.attach').addEvent('click', function () {
                Typecho.toggle('#upload-panel', this,
                '收起附件', '展开附件');
            });
            
            $('btn-save').removeProperty('disabled');
            $('btn-submit').removeProperty('disabled');
            
            $('btn-save').addEvent('click', function (e) {
                this.getParent('span').addClass('loading');
                this.setProperty('disabled', true);
                $(document).getElement('input[name=draft]').set('value', 1);
                $(document).getElement('form[name=write_post]').submit();
            });
            
            $('btn-submit').addEvent('click', function (e) {
                this.getParent('span').addClass('loading');
                this.setProperty('disabled', true);
                $(document).getElement('input[name=draft]').set('value', 0);
            });
            
            /** 标签自动完成 */
            var _tags = ["code python Pmoo.Tip"];
            
            /** 自动完成 */
            Typecho.autoComplete('#tags', _tags);
        });
    })();
</script>
<script type="text/javascript">
    var abc='';
    var textEditor = new Typecho.textarea('#text', {
        autoSaveTime: 5,
        resizeAble: true,
        autoSave: 'false',
        autoSaveMessageElement: 'auto-save-message',
        autoSaveLeaveMessage: '您的内容尚未保存, 是否离开此页面?',
        resizeUrl: '/action/ajax'
    });
	textEditor.textarea.addEvents({
		keydown: (function (evt) {
         	var field = this.textarea;
         	if (evt.code === 9) {
         		var instr = '	';
         		if (Browser.Engine.trident) {
         			//For IE
         			field.focus();
         			var sel  = document.selection.createRange(); 
         			sel.text = instr;
         			return false;
         		}
         		else if (Browser.Engine.gecko || Browser.Engine.webkit) {
         			//For Firefox/Safari/Chrome 
         			var startPos = field.selectionStart;
						var endPos 	 = field.selectionEnd;
						field.value  = [
							field.value.substring(0, startPos), 
							instr, 
							field.value.substring(endPos, field.value.length)
							].join('');
						var oriPos = startPos + instr.length;
						field.selectionStart = oriPos;
						field.selectionEnd	 = oriPos;
						return false;
         		}
         		else {
         			//For other not support browsers
         			//alert('Not support');
         			return true;
         		}
         	}
		}).bind(textEditor)	
	});
    /** 这两个函数在插件中必须实现 */
    var insertImageToEditor = function (title, url, link) {
        textEditor.setContent(['{{',url,'|',title,'}}'].join(''), '');
        new Fx.Scroll(window).toElement($(document).getElement('textarea#text'));
    };
    
    var insertLinkToEditor = function (title, url, link) {
    	textEditor.setContent(['[[',url,'|',title,']]'].join(''), '');
        new Fx.Scroll(window).toElement($(document).getElement('textarea#text'));
    };
</script>        		<script type="text/javascript" src="http://typecho/usr/plugins/Tyupoo/js/Pmoo/Pmoo.js"></script>
		<script type="text/javascript" src="http://typecho/usr/plugins/Tyupoo/js/Pmoo/Pmoo.Tip2.js"></script>
		<script type="text/javascript" src="http://typecho/usr/plugins/Tyupoo/js/Pmoo/Pmoo.Mask.js"></script>
		<script type="text/javascript" src="http://typecho/usr/plugins/Tyupoo/js/tyupoo.js"></script>
		<script type="text/javascript">
		Pmoo.Mask.ini_set('insertDom', true);
		Pmoo.Mask.show();
				var con = new Element('span',{
			styles : {
				'float' : 'right',
				'padding-right' : '5px'
			}
		});
		var cite = $('auto-save-message');
		con.inject(cite, 'before');
		con.innerHTML = '点击此<a id="authLink" href="http://www.yupoo.com/services/auth/?api_key=e3713343158bd447871123265bdc641c&frob=33650ad1bf8f26403760266b0bda63f4&perms=write&api_sig=f51243dbe6b4e55904ed68498b01abee" target="_blank">链接</a>完成Yupoo认证';
						$('authLink').addEvent('click', function(){
					setTimeout(function(){
						
					}, 1000);
				});
		</script>
<script type="text/javascript" src="http://typecho/admin/javascript/swfupload/swfupload.js?v=9.7.2"></script>
<script type="text/javascript" src="http://typecho/admin/javascript/swfupload/swfupload.queue.js?v=9.7.2"></script>
<script type="text/javascript">
    var deleteAttachment = function (cid, el) {
    
        var _title = $(el).getParent('li').getElement('strong');
        
        if (!confirm("你确认删除附件 %s 吗?".replace("%s", _title.get('text').trim()))) {
            return;
        }

        _title.addClass('delete');
        
        new Request.JSON({
            method : 'post',
            url : 'http://typecho/index.php/action/contents-attachment-edit',
            onComplete : function (result) {
                if (200 == result.code) {
                    $(el).getParent('li').destroy();
                } else {
                    _title.removeClass('delete');
                    alert('删除失败');
                }
            }
        }).send('do=delete&cid=' + cid);
    };

    (function () {

        window.addEvent('domready', function() {
            var _inited = false;
            
            //加强未加载暗示
            var uploadButton = $(document).getElement('#upload-panel .button')
            .setStyle('cursor', 'pointer')
            .addEvent('click', function () {
                alert('正在加载上传组件, 请稍候再试');
            });
            
            //begin parent tabshow
            $(document).getElement('#upload-panel').addEvent('tabShow', function () {
            
                if (_inited) {
                    return;
                }
                _inited = true;
                
                var swfuploadLoaded = function () {
                    uploadButton.removeEvent('click');
                };
            
                var fileDialogComplete = function (numFilesSelected, numFilesQueued) {
                    try {
                        this.startUpload();
                    } catch (ex)  {
                        this.debug(ex);
                    }
                };
            
                var uploadStart = function (file) {
                    var _el = new Element('li', {
                        'class' : 'upload-progress-item clearfix',
                        'id'    : file.id,
                        'text'  : file.name
                    });
                    
                    _el.inject($(document).getElement('ul.upload-progress'), 'top');
                };
                
                var uploadSuccess = function (file, serverData) {
                    var _el = $(document).getElement('#' + file.id);
                    var _result = JSON.decode(serverData);
                    
                    _el.set('html', '<strong>' + file.name + 
                    '<input type="hidden" name="attachment[]" value="' + _result.cid + '" /></strong>' + 
                    '<small><span class="insert">插入</span>' +
                    ' , <span class="delete">删除</span></small>');
                    _el.set('tween', {duration: 1500});
                    
                    _el.setStyles({
                        'background-image' : 'none',
                        'background-color' : '#D3DBB3'
                    });
                    
                    _el.tween('background-color', '#D3DBB3', '#FFFFFF');
                    
                    var _insertBtn = _el.getElement('.insert');
                    if (_result.isImage) {
                        _insertBtn.addEvent('click', function () {
                            insertImageToEditor(_result.title, _result.url, _result.permalink);
                        });
                    } else {
                        _insertBtn.addEvent('click', function () {
                            insertLinkToEditor(_result.title, _result.url, _result.permalink);
                        });
                    }
                    
                    var _deleteBtn = _el.getElement('.delete');
                    _deleteBtn.addEvent('click', function () {
                        deleteAttachment(_result.cid, this);
                    });
                };
                
                var uploadComplete = function (file) {
                    //console.dir(file);
                };
                
                var uploadError = function (file, errorCode, message) {
                    var _el = $(document).getElement('#' + file.id);
                    var _fx = new Fx.Tween(_el, {duration: 3000});
                    
                    _el.set('html', '<strong>' + file.name + ' 上传失败</strong>');
                    _el.setStyles({
                        'background-image' : 'none',
                        'color'            : '#FFFFFF',
                        'background-color' : '#CC0000'
                    });
                    
                    _fx.addEvent('complete', function () {
                        _el.destroy();
                    });
                    
                    _fx.start('background-color', '#CC0000', '#F7FBE9');
                };
                
                var uploadProgress = function (file, bytesLoaded, bytesTotal) {
                    var _el = $(document).getElement('#' + file.id);
                    var percent = Math.ceil((1 - (bytesLoaded / bytesTotal)) * _el.getSize().x);
                    _el.setStyle('background-position', '-' + percent + 'px 0');
                };
            
                var swfu, _size = $(document).getElement('.typecho-list-operate a.button').getCoordinates(),
                settings = {
                    flash_url : "http://typecho/admin/javascript/swfupload/swfupload.swf",
                    upload_url: "http://typecho/index.php/action/upload",
                    post_params: {"__typecho_uid" : "1", 
                    "__typecho_authCode" : "$T$Sk3o^xN`}eee2a240a1c14ab45b2ea7d859b5a4af"},
                    file_size_limit : "10485760 byte",
                    file_types : "*.jpg;*.gif;*.png;*.zip;*.tar.gz",
                    file_types_description : "所有文件",
                    file_upload_limit : 100,
                    file_queue_limit : 0,
                    debug: false,
                    
                    //Handle Settings
                    file_dialog_complete_handler : fileDialogComplete,
                    upload_start_handler : uploadStart,
                    upload_progress_handler : uploadProgress,
                    upload_success_handler : uploadSuccess,
                    queue_complete_handler : uploadComplete,
                    upload_error_handler : uploadError,
                    swfupload_loaded_handler : swfuploadLoaded,
                    
                    // Button Settings
                    button_placeholder_id : "swfu-placeholder",
                    button_height: 25,
                    button_text: '',
                    button_text_style: '',
                    button_text_left_padding: 14,
                    button_text_top_padding: 0,
                    button_width: _size.width,
                    button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
                    button_cursor: SWFUpload.CURSOR.HAND
                };

                swfu = new SWFUpload(settings);
                
            });
            //end parent tabshow
        });
    })();
</script>
    </body>
</html>
